<?php $this->beginWidget('webroot.widgets.iButtonBar');?>

<?php $this->widget('bootstrap.widgets.TbButton', array(
    'label'=>Yii::t('main', 'Advanced Search'),
    'type'=>'primary',
	'icon'=>'search white',
    'url'=> '#',
	'htmlOptions'=>array('class'=>'search-button')
));?>
<?php $this->endWidget();?>
<?php

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('comment-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>


<div class="search-form">
<?php $this->renderPartial('_search', array(
	'model' => $model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('backend.widgets.iGridView', array(
	'id' => 'delivery-customer-model-grid',
	'dataProvider' => $model->search(),
	'filter' => $model,
	'columns' => array(
		array(
			'name'=>'id',
			'htmlOptions'=>array('width'=>100)
		),
		'code',
		'name',
		'address',
		'phone',
		array(
			'name' => 'status',
			'type'=>'raw',
			'value' => '($data->status == 0) ? "<span style=\"color:red;font-weight: bold\">".Yii::t(\'DeliveryModule.main\', \'Not Active\')."</span>" : "<span style=\"color:#1FD51F;font-weight: bold\">".Yii::t(\'DeliveryModule.main\', \'Actived\')."</span>"',
			'filter' => array('0' => Yii::t('DeliveryModule.main', 'Not Active'), '1' => Yii::t('DeliveryModule.main', 'Actived')),
		),
		/*'billing_address',
		'mst',
		'fax',
		'person_contact',
		'email',
		'office_offer',
		'office_person',
		'created_datetime',
		'updated_datetime',
		array(
					'name' => 'status',
					'value' => '($data->status === 0) ? Yii::t(\'app\', \'No\') : Yii::t(\'app\', \'Yes\')',
					'filter' => array('0' => Yii::t('app', 'No'), '1' => Yii::t('app', 'Yes')),
					),
		*/
		array(
				'class'=>'webroot.widgets.iButtonColumn',
				'htmlOptions'=>array('width'=>'50'),
		),
	),
)); ?>